// Copyright 2012, Jun Chen .All rights reserved.
//
// Use of this source code is governed by a BSD-Style license that can be
// found in the License fule.
//
// Author: cpp.cheen at gmail dot com.


#ifndef SOCKET_WARP_H
#define SOCKET_WARP_H

#include    "pch_files.h"
#include    <sys/socket.h>

class   io_buffer;
class   endpoint_ipv4;


class socket_nb
{
    public:

    static  x_int32     do_read(x_fd fd,io_buffer& buffer);
    static  x_int32     do_write(x_fd fd,const io_buffer& buffer);
    static  x_int32     do_shutdown(x_fd fd, x_int32 how);
    static  x_int32     do_close(x_fd fd);

    static  x_int32     do_listen(x_fd fd, const endpoint_ipv4& addr);
    static  x_int32     do_connect(x_fd fd,const endpoint_ipv4& host);
    static  x_int32     do_accept(x_fd fd, endpoint_ipv4& peer);
    protected:
    private:
    socket_nb();
    ~socket_nb();
};

#endif // SOCKET_WARP_H
